package com.xw.controller;

import com.xw.common.Constants;
import com.xw.common.Result;
import com.xw.service.OperationLogService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 72478
 * @Description: 操作日志控制器
 * @Date: 2024/12/18 16:53
 * @Version: 1.0
 */
@RestController
@RequestMapping("/api/logs")
public class OperationLogController {

    private final OperationLogService operationLogService;

    public OperationLogController(OperationLogService operationLogService) {
        this.operationLogService = operationLogService;
    }

    @GetMapping
    public Result<?> getAllLogs() {
        return new Result<>(operationLogService.getAllLogs(), Constants.SUCCESS);
        // 调用 Service 的 getAllLogs 方法
    }
}
